/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.promotion;

import com.enation.app.javashop.client.promotion.CouponClient;
import com.enation.app.javashop.core.client.fallback.promotion.CouponClientFallbackFactory;
import com.enation.app.javashop.core.client.fallback.system.ValidatorClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.promotion.coupon.dos.CouponDO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 订单查询Feign
 *
 * @author Snow create in 2018/8/6
 * @version v2.0
 * @since v7.0.0
 */
@FeignClient(name = "promotion-service", fallbackFactory = CouponClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface CouponClientFeignImpl extends CouponClient {


    @Override
    @RequestMapping(value = "/client/trade/coupons/{id}", method = RequestMethod.GET)
    CouponDO getModel(@PathVariable("id") Long id);

    @Override
    @RequestMapping(value = "/client/trade/coupons/{coupon_id}/use", method = RequestMethod.POST)
    void addReceivedNum(@PathVariable("coupon_id") Long couponId);

    @Override
    @RequestMapping(value = "/client/trade/coupons/{coupon_id}/use/add-num", method = RequestMethod.POST)
    void addUsedNum(@PathVariable("coupon_id")Long id);

    @Override
    @RequestMapping(value = "/client/trade/coupons/seller/{seller_id}", method = RequestMethod.GET)
    List<CouponDO> getList(@PathVariable("seller_id")Long sellerId);


    @Override
    @RequestMapping(value = "/client/trade/coupons/{shop_id}/shop-name", method = RequestMethod.POST)
    void editCouponShopName(@PathVariable("shop_id") Long shopId, @RequestParam("shop_name") String shopName);

}
